<template>
  <div class="content">
    <div>
      <div class="row">可提现金额：{{userInfo.jiangjin}}</div>
      <div class="row">提现金额：<input class="inp" v-model='tixianNum' value="0" type="text" @input="tixianMoney" placeholder="请输入要提现的金额"></div>
      <div class="row">
        <div class="sub" @click="tixian()">确认提现</div>
        </div>
    </div>
  </div>
</template>

<script>
import { postData } from '../common/js/axios'
export default {
  data () {
    return {
      userInfo: '',
      tixianNum: 0
    }
  },
  methods: {
    tixian: function () {
      console.log('tixian')
      let Obj = {}
      Obj.username = 'user888'
      Obj.tx_money = this.tixianNum
      Obj.tx_pwd = '123456'
      Obj.msg_id = '123'
      postData('/Tixian/tixian', Obj)
        .then(res => {
          console.log(res)
          alert(res.message)
        })
      // postData('/Tixian/tixian', Obj)  // 测试并发
      //   .then(res => {
      //     console.log(res)
      //     alert(res.message)
      //   })
      // postData('/Tixian/tixian', Obj)  // 测试并发
      //   .then(res => {
      //     console.log(res)
      //     alert(res.message)
      //   })
    },
    tixianMoney: function () {
      console.log(this.tixianNum)
    }
  },
  created () {
    let username = 'user888'
    let Obj = {}
    Obj.username = username
    postData('/User/userBaseInfo', Obj)
      .then(res => {
        console.log(res)
        this.userInfo = res
      })
  }
}
</script>

<style lang="stylus" scoped>
.content
  width 10rem
  left 0
  top 0
  z-index 102
  background #fff
  position fixed
  border-radius 0
  padding 0
  margin 0
  bottom 0
  padding-left 0.5rem;
  box-sizing border-box
  .row
    width 10rem;
    height 1rem;
    line-height 1rem;
    .inp
      width 5rem;
      height 0.6rem;
      line-height 0.8rem;
      border-radius 2px;
      border 1px solid #333;
    .sub
      width 3rem
      height 0.6rem
      line-height 0.6rem
      text-align center
      background #ff0000
      color #fff;
</style>
